# -*- coding: utf-8 -*-
# @File     : validation.py
# @Author   : bingjia
# @Time     : 2020/6/4
# @Desc     : 验证

from apps.users.models import User


def user_validation(request, username):
    """
    用户验证
    :param request: request
    :param username: 用户名
    :return:
    """
    if request.session["user_info"]["username"] == username:
        return True
    else:
        return False


def is_project_owner(request):
    pass


def is_superuser(username):
    """
    是否是超级管理员
    :param username:
    :return:
    """

    return User.objects.get(username=username).is_superuser





